RAG routing hardening, registry corpus embedding, and review docs#443
Conversation
… claude/llm-pipeline-review
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
- Defer embedding until after text/document fast paths and coverage gate - Rehydrate cached document metadata in attachDocumentRankingMetadata - Load env-dependent script imports after loadEnvConfig in seed/reindex scripts - Harden registry corpus: shared identity, medication tags, rollback, detail hrefs - Route registry citations to detail pages; handle registry rows in signed-url API - Prioritize safety warnings over registry info; preserve stale registry labels - Guard OCR repair against dropping isolated single-letter clinical tokens - Update skill docs, changelog dedup, CI Supabase setup-cli@v3 Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
- Backfill NULL document_images.index_generation_id during re-stamp - Count globally forced embedding eval cases in retrieval summaries Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Treat NULL document_images.index_generation_id as stale even when JSON metadata already matches the committed generation, and propagate global --force-embedding into eval reporting/validation so index-unit-vector runs count forced cases correctly. Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
… codex/pr433-fix # Conflicts: # .cursor/skills/supabase-postgres-best-practices/CHANGELOG.md # .cursor/skills/supabase-postgres-best-practices/references/security-rls-performance.md # scripts/reindex-image-generation-metadata.ts # src/lib/differential-seed.ts # src/lib/document-index-units.ts # src/lib/medication-seed.ts # src/lib/rag.ts # src/lib/registry-corpus.ts # src/lib/registry-seed.ts # src/lib/source-governance.ts # src/lib/source-metadata.ts # supabase/migrations/20260708160000_retrieval_owner_matches_fail_closed.sql # supabase/migrations/20260708160001_retrieval_owner_matches_fail_closed.sql # supabase/migrations/20260708161000_retrieval_owner_matches_fail_closed.sql # tests/document-index-units.test.ts # tests/registry-corpus.test.ts # tests/source-governance.test.ts
PR #433 preview branch recorded 20260708160000 before the file was removed, causing remote migration versions not found in local migrations directory. Keep a no-op stub for history sync; transactional index DDL stays on 170000. Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(rag): finish registry re-embed and quality routing * fix: resolve merge conflicts with claude/llm-pipeline-review --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
… claude/llm-pipeline-review # Conflicts: # tests/rag-routing.test.ts
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThis PR updates RAG routing and extractive gating, adds registry re-embed tooling and CLI owner listing, and introduces drift-check, schema permission, and review-process documentation changes. ChangesClinical RAG retrieval and routing behavior
Registry corpus embedding and re-embed-on-edit tooling
Drift CI workflow, schema grants, and review protocol docs
Estimated code review effort: 4 (Complex) | ~60 minutes 🚥 Pre-merge checks | ✅ 5 | ❌ 6❌ Failed checks (6 inconclusive)
✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Comment |
|
@copilot resolve the merge conflicts in this pull request |
|
Updates to Preview Branch (claude/llm-pipeline-review) ↗︎
Tasks are run on every commit but only new migration files are pushed.
View logs for this Workflow Run ↗︎. |
This comment was marked as resolved.
This comment was marked as resolved.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 632e90477b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 632e90477b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Head branch was pushed to by a user without write access
Summary
table_thresholdextractive shortcuts when retrieval gaps/conflicts are actionable.src/lib/rag-extractive-answer.tsand restore default OpenAI SDK retry budget for answer generation (removemaxRetries: 0).scripts/embed-registry-records.ts,src/lib/registry-corpus.ts) and document hybrid-RAG/registry findings indocs/rag-hybrid-findings-and-todo.md.live-drift.ymlworkflow with service-role key scoped only to drift-check steps (notnpm ci).Verification
npm run verify:cheap— lint, typecheck, and 1412 unit tests passed locally (2026-07-09)npm run verify:uiwhen UI, routing, styling, browser behavior, reduced-motion, or forced-colors behavior changednpm run verify:releasebefore release or handoff confidence claimsnpm run format:check— passed after Prettier on touched source filesnpm run eval:retrieval:quality(must stay 36/36) when retrieval, ranking, selection, chunking, or scoring behavior changed — ran locally asnpm run eval:retrieval:quality -- --force-embedding: passed withdocument_recall_at_5=1,content_recall_at_5=1,top_k_hit_rate=1,force_embedding_failure_count=0,failed_cases=[](documented indocs/rag-hybrid-findings-and-todo.md)npm run eval:rag -- --limit 15+npm run eval:quality -- --rag-onlywhen answer generation, the synthesis prompt, or answer post-processing changed (grounded-supported must not drop; citation-failure 0)npm run check:production-readinesswhen clinical workflow, privacy, environment, Supabase, source governance, or deployment behavior changednpm run check:deployment-readinesswhen deployment startup, hosting, or rollout behavior changedClinical Governance Preflight
Complete this section when the change touches ingestion, answer generation, search/ranking, source rendering, document access, privacy, production env, or clinical output.
Clinical KB Database(sjrfecxgysukkwxsowpy)Notes
npm run eval:retrieval:quality -- --force-embedding(36/36, recall metrics 1.0).documents+document_chunksupserts with client-side rollback on chunk failure; atomic Postgres RPC remains a follow-up (CodeRabbit data-integrity comment deferred to avoid scope creep in this docs/routing PR).0.0227and RAG latency thresholds — not introduced by this routing/docs pass.